home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntinc25 / gemfast.h < prev    next >
C/C++ Source or Header  |  1992-10-18  |  13KB  |  532 lines

  1. #ifndef _GEMFAST_H
  2. #define _GEMFAST_H
  3.  
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7.  
  8. /**************************************************************************
  9.  *
  10.  * GEMFAST.H - Header file for common VDI and AES symbols.    
  11.  *
  12.  *  This header file contains items compatible with both GEMDEFS and OBDEFS
  13.  *  from the Alcyon system.  Note that there are no 'extern' definitions
  14.  *  for the functions, because they all return a signed short and work
  15.  *  fine as autodefined functions.
  16.  *
  17.  *  If you have a lot of source already coded for #include <gemdefs.h>,
  18.  *  you can continue to use your original gemdefs file, or you can rename
  19.  *  this file to gemdefs.h; if your source also includes obdefs.h, remove
  20.  *  them when using this file.
  21.  *  (i have links called obdefs and gemdefs, since this file is now protected
  22.  *   against multiple inclusions -- ++jrb)
  23.  *
  24.  * Credits dept:
  25.  *    This file bears an amazing similarity to the original Alcyon GEMDEFS
  26.  *    and OBDEFS header files, which are copyrighted by Atari.  What can I
  27.  *    say?  Copyrighted or not, these are the names and values that every-
  28.  *    body uses, so of course the files look *awful* similar...
  29.  *
  30.  *************************************************************************/
  31.  
  32.         /* evnt_multi flags */
  33. #define MU_KEYBD    0x0001
  34. #define MU_BUTTON    0x0002
  35. #define MU_M1        0x0004
  36. #define MU_M2        0x0008
  37. #define MU_MESAG    0x0010
  38. #define MU_TIMER    0x0020
  39.         /* keyboard states */
  40. #define K_RSHIFT    0x0001
  41. #define K_LSHIFT    0x0002
  42. #define K_CTRL         0x0004
  43. #define K_ALT        0x0008
  44.         /* event message values */
  45. #define MN_SELECTED    10
  46. #define WM_REDRAW    20
  47. #define WM_TOPPED    21
  48. #define WM_CLOSED    22
  49. #define WM_FULLED    23
  50. #define WM_ARROWED    24
  51. #define WM_HSLID    25
  52. #define WM_VSLID    26
  53. #define WM_SIZED    27
  54. #define WM_MOVED    28
  55. #define WM_NEWTOP    29
  56. #define AC_OPEN        40
  57. #define AC_CLOSE    41
  58.         /* Xcontrol messages */
  59. #define CT_UPDATE    50
  60. #define CT_MOVE        51
  61. #define CT_NEWTOP    52
  62. #define CT_KEY        53
  63.  
  64.         /* form_dial opcodes */
  65. #define FMD_START    0
  66. #define FMD_GROW    1
  67. #define FMD_SHRINK    2
  68. #define FMD_FINISH    3
  69.         /* rsrc_gaddr structure types */
  70. #define R_TREE         0 
  71. #define R_OBJECT    1
  72. #define R_TEDINFO    2
  73. #define R_ICONBLK    3
  74. #define R_BITBLK    4
  75. #define R_STRING    5
  76. #define R_IMAGEDATA 6
  77. #define R_OBSPEC    7
  78. #define R_TEPTEXT    8
  79. #define R_TEPTMPLT    9
  80. #define R_TEPVALID    10
  81. #define R_IBPMASK    11 
  82. #define R_IBPDATA    12    
  83. #define R_IBPTEXT    13
  84. #define R_BIPDATA    14
  85. #define R_FRSTR        15
  86. #define R_FRIMG        16 
  87.         /* Window Attributes */
  88. #define NAME        0x0001
  89. #define CLOSER         0x0002
  90. #define FULLER         0x0004
  91. #define MOVER        0x0008
  92. #define INFO        0x0010
  93. #define SIZER        0x0020
  94. #define UPARROW        0x0040
  95. #define DNARROW        0x0080
  96. #define VSLIDE         0x0100
  97. #define LFARROW        0x0200
  98. #define RTARROW        0x0400
  99. #define HSLIDE         0x0800
  100.         /* wind_create flags */
  101. #define WC_BORDER    0
  102. #define WC_WORK        1
  103.         /* wind_get flags */
  104. #define WF_KIND         1
  105. #define WF_NAME         2
  106. #define WF_INFO         3
  107. #define WF_WORKXYWH      4
  108. #define WF_CURRXYWH     5
  109. #define WF_PREVXYWH      6
  110. #define WF_FULLXYWH      7
  111. #define WF_HSLIDE    8
  112. #define WF_VSLIDE    9
  113. #define WF_TOP          10
  114. #define WF_FIRSTXYWH     11
  115. #define WF_NEXTXYWH      12
  116. #define WF_RESVD    13
  117. #define WF_NEWDESK    14
  118. #define WF_HSLSIZE    15
  119. #define WF_VSLSIZE    16
  120. #define WF_SCREEN    17
  121. #define WF_COLOR    18
  122. #define WF_DCOLOR    19
  123.         /* window elements    */
  124. #define W_BOX        0
  125. #define W_TITLE        1
  126. #define W_CLOSER    2
  127. #define W_NAME        3
  128. #define W_FULLER    4
  129. #define W_INFO        5
  130. #define W_DATA        6
  131. #define W_WORK        7
  132. #define W_SIZER        8
  133. #define W_VBAR        9
  134. #define W_UPARROW    10
  135. #define W_DNARROW    11
  136. #define W_VSLIDE    12
  137. #define W_VELEV        13
  138. #define W_HBAR        14
  139. #define W_LFARROW    15
  140. #define W_RTARROW    16
  141. #define W_HSLIDE    17
  142. #define W_HELEV        18
  143.         /* arrow message    */
  144. #define WA_UPPAGE     0
  145. #define WA_DNPAGE     1
  146. #define WA_UPLINE     2
  147. #define WA_DNLINE     3
  148. #define WA_LFPAGE     4
  149. #define WA_RTPAGE     5
  150. #define WA_LFLINE     6
  151. #define WA_RTLINE     7
  152.  
  153.         /* wind_update flags */
  154. #define END_UPDATE    0
  155. #define BEG_UPDATE    1
  156. #define END_MCTRL    2
  157. #define BEG_MCTRL    3
  158.         /* graf_mouse mouse types*/
  159. #define ARROW        0
  160. #define BEE        2
  161. #define BUSY_BEE    BEE        /* alias */
  162. #define TEXT_CRSR    1
  163. #define HOURGLASS    2
  164. #define POINT_HAND    3
  165. #define FLAT_HAND    4
  166. #define THIN_CROSS    5
  167. #define THICK_CROSS    6
  168. #define OUTLN_CROSS     7
  169. #define USER_DEF    255
  170. #define M_OFF        256
  171. #define M_ON        257
  172.         /* objects - general */
  173. #define ROOT 0                /* index of ROOT            */
  174. #define MAX_LEN     81        /* max string length        */
  175. #define MAX_DEPTH    8        /* max depth of search or draw  */
  176.         /* inside fill patterns    */
  177. #define IP_HOLLOW    0
  178. #define IP_1PATT    1
  179. #define IP_2PATT    2
  180. #define IP_3PATT    3
  181. #define IP_4PATT    4
  182. #define IP_5PATT    5
  183. #define IP_6PATT    6
  184. #define IP_SOLID    7
  185.         /* normal graphics drawing modes */
  186. #define MD_REPLACE    1
  187. #define MD_TRANS    2
  188. #define MD_XOR         3
  189. #define MD_ERASE    4
  190.  
  191.         /* bit blt rules */
  192. #define ALL_WHITE    0
  193. #define S_AND_D        1
  194. #define S_AND_NOTD    2
  195. #define S_ONLY         3
  196. #define NOTS_AND_D    4
  197. #define D_ONLY         5
  198. #define S_XOR_D        6
  199. #define S_OR_D         7
  200. #define NOT_SORD    8
  201. #define NOT_SXORD    9
  202. #define D_INVERT    10
  203. #define NOT_D        10
  204. #define S_OR_NOTD    11
  205. #define NOT_S        12
  206. #define NOTS_OR_D    13
  207. #define NOT_SANDD    14
  208. #define ALL_BLACK    15
  209.  
  210.         /* font types */
  211. #define IBM 3
  212. #define SMALL 5
  213.  
  214.         /* object types */
  215. #define G_BOX        20
  216. #define G_TEXT         21
  217. #define G_BOXTEXT    22
  218. #define G_IMAGE        23
  219. #define G_USERDEF    24
  220. #define G_IBOX         25
  221. #define G_BUTTON    26
  222. #define G_BOXCHAR    27
  223. #define G_STRING    28
  224. #define G_FTEXT        29
  225. #define G_FBOXTEXT    30
  226. #define G_ICON         31
  227. #define G_TITLE        32
  228.         /* object flags */
  229. #define NONE        0x0000
  230. #define SELECTABLE    0x0001
  231. #define DEFAULT        0x0002
  232. #define EXIT        0x0004
  233. #define EDITABLE    0x0008
  234. #define RBUTTON        0x0010
  235. #define LASTOB         0x0020
  236. #define TOUCHEXIT    0x0040
  237. #define HIDETREE    0x0080
  238. #define INDIRECT    0x0100
  239.         /* Object states */
  240. #define NORMAL         0x0000
  241. #define SELECTED    0x0001
  242. #define CROSSED        0x0002
  243. #define CHECKED        0x0004
  244. #define DISABLED    0x0008
  245. #define OUTLINED    0x0010
  246. #define SHADOWED    0x0020
  247.         /* Object colors - default pall. */
  248. #define WHITE    0
  249. #define BLACK    1
  250. #define RED      2
  251. #define GREEN    3
  252. #define BLUE     4
  253. #define CYAN     5
  254. #define YELLOW   6
  255. #define MAGENTA  7
  256. #define LWHITE   8
  257. #define LBLACK   9
  258. #define LRED     10
  259. #define LGREEN   11
  260. #define LBLUE    12
  261. #define LCYAN    13
  262. #define LYELLOW  14
  263. #define LMAGENTA 15
  264.         /* editable text field definitions */
  265. #define EDSTART        0
  266. #define EDINIT         1
  267. #define EDCHAR         2
  268. #define EDEND        3
  269.         /* editable text justification */
  270. #define TE_LEFT        0
  271. #define TE_RIGHT    1
  272. #define TE_CNTR        2
  273.  
  274.         /* file attr for dos_create    */
  275. #define    F_ATTR        0    
  276.  
  277.         /* VDI Memory Form Definition Block */
  278.  
  279. #ifndef __MFDB__
  280. #ifndef _ALT_MFDB
  281. #ifndef __ALT_MFDB__
  282.  
  283. #define __MFDB__
  284.  
  285. typedef struct
  286. {
  287.     long        fd_addr;    /* Addrerss of upper left corner of first*/
  288.                                     /* plane of raster area. If NULL then   */
  289.                                     /* MFDB is for a physical device        */
  290.     short        fd_w;        /* Form Width in Pixels                 */
  291.     short        fd_h;       /* Form Height in Pixels                */
  292.     short        fd_wdwidth; /* Form Width in shorts(fd_w/sizeof(int)*/
  293.     short        fd_stand;   /* Form format 0= device spec 1=standard*/
  294.     short        fd_nplanes; /* Number of memory planes              */
  295.     short        fd_r1;      /* Reserved                             */
  296.     short        fd_r2;      /* Reserved                             */
  297.     short        fd_r3;      /* Reserved                             */
  298. } MFDB;
  299. #endif
  300. #endif
  301. #endif    /* __MFDB__ */
  302.  
  303. #ifdef __ALT_MFDB__
  304. /* some software seems to wants this format for FDB. to get it, define
  305.    __ALT_MFDB__
  306.  */
  307. #ifdef __MFDB__
  308. # error conflicting types for MFDB
  309. #endif
  310.  
  311. #define __MFDB__
  312. typedef struct
  313. {
  314.     long    mp;
  315.     short    fwp;
  316.     short    fh;
  317.     short    fww;
  318.     short    ff;
  319.     short    np;
  320.     short    r1;
  321.     short    r2;
  322.     short    r3;
  323. } MFDB;
  324. #endif /* __ALT_MFDB__ */
  325.  
  326.         /* Mouse Form Definition Block */
  327. typedef struct mouse_form
  328.     {
  329.     short    mf_xhot;
  330.     short     mf_yhot;
  331.     short     mf_nplanes;
  332.     short    mf_bg;
  333.     short     mf_fg;
  334.     short     mf_mask[16];
  335.     short     mf_data[16];
  336.     } MFORM ;
  337.  
  338. typedef struct mouse_event_type
  339.     {
  340.     int    *x;
  341.     int     *y;
  342.     int    *b;
  343.     int    *k;
  344.     } Mouse;
  345.  
  346. typedef struct graphic_rectangle
  347.     {    /* note these three rect structs are deliberately ints */
  348.     int g_x;
  349.     int g_y;
  350.     int g_w;
  351.     int g_h;
  352.     } GRECT;
  353.  
  354. typedef struct vdi_rectangle
  355.     {
  356.     int v_x1;
  357.     int v_y1;
  358.     int v_x2;
  359.     int v_y2;
  360.     } VRECT;
  361.  
  362. typedef struct orect
  363. {
  364.         struct orect    *o_link;
  365.     int    o_x;
  366.     int    o_y;
  367.     int    o_w;
  368.     int    o_h;
  369. } ORECT;
  370.  
  371. typedef struct rect_for_rect_utils
  372.     {    /* note these three rect structs are deliberately ints */
  373.     int x;
  374.     int y;
  375.     int w;
  376.     int h;
  377.     } Rect;
  378.  
  379. typedef struct text_edinfo
  380.     {
  381.     char *te_ptext;            /* ptr to text             */
  382.     char *te_ptmplt;        /* ptr to template            */
  383.     char *te_pvalid;        /* ptr to validation chrs.   */
  384.     short    te_font;        /* font                    */
  385.     short    te_junk1;         /* junk word                */
  386.     short    te_just;        /* justification            */
  387.     short    te_color;         /* color information word    */
  388.     short    te_junk2;         /* junk word                */
  389.     short    te_thickness;        /* border thickness         */
  390.     short    te_txtlen;        /* length of text string     */
  391.     short    te_tmplen;        /* length of template string */
  392.     } TEDINFO;
  393.  
  394. typedef struct icon_block
  395.     {
  396.     short    *ib_pmask;
  397.     short    *ib_pdata;
  398.     char     *ib_ptext;
  399.     short    ib_char;
  400.     short    ib_xchar;
  401.     short    ib_ychar;
  402.     short    ib_xicon;
  403.     short    ib_yicon;
  404.     short    ib_wicon;
  405.     short    ib_hicon;
  406.     short    ib_xtext;
  407.     short    ib_ytext;
  408.     short    ib_wtext;
  409.     short    ib_htext;
  410.         short   ib_resvd;
  411.     } ICONBLK;
  412.  
  413. typedef struct bit_block
  414.     {
  415.     char     *bi_pdata;            /* ptr to bit forms data  */
  416.     short    bi_wb;                /* width of form in bytes */
  417.     short    bi_hl;                /* height in lines */
  418.     short    bi_x;                /* source x in bit form     */
  419.     short    bi_y;                /* source y in bit form     */
  420.     short    bi_color;             /* fg color of blt */
  421.  
  422.     } BITBLK;
  423.  
  424. typedef struct user_block
  425.     {
  426.         int  (*ub_code)(void *parmblock); /* really PARMBLK *parmblock */
  427.     long ub_parm;
  428.     } USERBLK;
  429.  
  430. #ifndef __TCC_COMPAT__
  431. typedef struct object
  432.     {
  433.     short    ob_next;    /* -> object's next sibling            */
  434.     short    ob_head;    /* -> head of object's children       */
  435.     short    ob_tail;    /* -> tail of object's children       */
  436.     unsigned short ob_type;    /* type of object              */
  437.     unsigned short ob_flags;/* flags                  */
  438.     unsigned short ob_state;/* state                  */
  439.     unsigned long  ob_spec;    /* object-specific data              */
  440.     short    ob_x;        /* upper left corner of object           */
  441.     short    ob_y;        /* upper left corner of object           */
  442.     short    ob_width;     /* width of obj                  */
  443.     short    ob_height;    /* height of obj              */
  444.     } OBJECT;
  445. #else
  446.  
  447. typedef struct {
  448.     unsigned short character   :  8;
  449.     signed   short framesize   :  8;
  450.     unsigned short framecol    :  4;
  451.     unsigned short textcol     :  4;
  452.     unsigned short textmode    :  1;
  453.     unsigned short fillpattern :  3;
  454.     unsigned short interiorcol :  4;
  455. } bfobspec;
  456.  
  457. typedef union __u_ob_spec {
  458.     TEDINFO        *tedinfo;
  459.     long        index;
  460.     char        *free_string;
  461.     union __u_ob_spec *indirect;
  462.         bfobspec    obspec;
  463.     BITBLK        *bitblk;
  464.     ICONBLK        *iconblk;
  465.         USERBLK     *userblk;
  466. /*    APPLBLK        *applblk;
  467.     char        *string;    */
  468. } U_OB_SPEC;
  469.  
  470. typedef struct object
  471.     {
  472.     short    ob_next;    /* -> object's next sibling            */
  473.     short    ob_head;    /* -> head of object's children       */
  474.     short    ob_tail;    /* -> tail of object's children       */
  475.     unsigned short ob_type;    /* type of object              */
  476.     unsigned short ob_flags;/* flags                  */
  477.     unsigned short ob_state;/* state                  */
  478.     U_OB_SPEC      ob_spec;    /* object-specific data              */
  479.     short    ob_x;        /* upper left corner of object           */
  480.     short    ob_y;        /* upper left corner of object           */
  481.     short    ob_width;     /* width of obj                  */
  482.     short    ob_height;    /* height of obj              */
  483.     } OBJECT;
  484. #endif
  485.  
  486. typedef struct parm_block
  487.     {
  488.     OBJECT     *pb_tree;
  489.     short    pb_obj;
  490.     short    pb_prevstate;
  491.     short    pb_currstate;
  492.     short    pb_x, pb_y, pb_w, pb_h;
  493.     short    pb_xc, pb_yc, pb_wc, pb_hc;
  494.     long     pb_parm;
  495.     } PARMBLK;
  496.  
  497.                         /* used in RSCREATE.C    */
  498. typedef struct rshdr
  499. {
  500.     short        rsh_vrsn;
  501.     unsigned short    rsh_object;
  502.     unsigned short    rsh_tedinfo;
  503.     unsigned short    rsh_iconblk;    /* list of ICONBLKS        */
  504.     unsigned short    rsh_bitblk;
  505.     unsigned short    rsh_frstr;    
  506.     unsigned short    rsh_string;
  507.     unsigned short    rsh_imdata;    /* image data            */
  508.     unsigned short    rsh_frimg;    
  509.     unsigned short    rsh_trindex;
  510.     short        rsh_nobs;    /* counts of various structs    */
  511.     short        rsh_ntree;
  512.     short        rsh_nted;
  513.     short        rsh_nib;
  514.     short        rsh_nbb;
  515.     short        rsh_nstring;
  516.     short        rsh_nimages;
  517.     unsigned short    rsh_rssize;    /* total bytes in resource    */
  518. } RSHDR;
  519.  
  520. #define DESKTOP_HANDLE 0
  521.  
  522. /* (user visible) binding arrays */
  523. extern short         _intin[], _intout[], _ptsin[], _ptsout[];
  524. extern void          *_addrin[], *_addrout[];
  525. extern int        gl_apid, gl_ap_version;
  526.  
  527. #ifdef __cplusplus
  528. }
  529. #endif
  530.  
  531. #endif /* _GEMFAST_H */
  532.